﻿using MyWebApiApp.Entitys;

namespace MyWebApiApp
{
    public class BackTask : BackgroundService
    {
        IServiceProvider ServiceProvider;
        public BackTask(IServiceProvider serviceProvider)
        {
            ServiceProvider = serviceProvider;
        }

        protected override async Task ExecuteAsync(CancellationToken stoppingToken)
        {
            using var scope = ServiceProvider.CreateScope();
            EFDbContext eFDbContext = scope.ServiceProvider.GetRequiredService<EFDbContext>();
            var a = eFDbContext.Users.ToList();
            List<string> guids1 = new List<string>();
            List<string> guids2 = new List<string>();
            List<string> guids3 = new List<string>();
            for (int i = 0; i < 5; i++)
            {
                guids1.Add(Constants.Guid);
                guids2.Add(Constants.Guid2);
                guids3.Add(Constants.GetGuid());
            }
            await Task.Delay(200);
        }
    }
}
